package com.liushao.controller.admin;


import com.liushao.entity.UserLoginRecord;
import com.liushao.result.Result;
import com.liushao.service.UserLoginRecordService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author chen
 * @since 2025-01-03
 */
@RestController
@RequestMapping("/admin/core/userLoginRecord")
public class UserLoginRecordController {

    @Autowired
    private UserLoginRecordService userLoginRecordService;

    // http://localhost/admin/core/userLoginRecord/listTop50/16

    @GetMapping("/listTop50/{userId}")
    public Result listTop50(
            @ApiParam(value = "用户id",required = true)
            @PathVariable Long userId
    ){

     List<UserLoginRecord> userLoginRecordList= userLoginRecordService.listTop50(userId);
        return  Result.ok().data("list",userLoginRecordList);

    }

}

